/**
 * related to mainCategory.ui
 * 
 * @Author : chenglm
 * @Timestamp : 2016-08-22
 */
var root=ui("$");
var helperOpen = require("helper/open");
var homemakingUtil = require("url/homemaking");
var service1 = ui("service1");
var service2 = ui("service2");
var service3 = ui("service3");
var typeALayouts = [service1,service2,service3];
root.setMapping({
	"service1.tag":"rcbjType.parentId",
	"name1.text":"rcbjType.name",
	"remark1.text":"rcbjType.remark",
	"img1.source":"rcbjType.smallImg",
	
	"service2.tag":"jdwxType.id",
	"name2.text":"jdwxType.name",
	"remark2.text":"jdwxType.remark",
	"img2.source":"jdwxType.smallImg",
	
	"service3.tag":"jdqxType.id",
	"name3.text":"jdqxType.name",
	"remark3.text":"jdqxType.remark",
	"img3.source":"jdqxType.smallImg"
});
typeALayouts.forEach(function(dc,i){
	dc.on("touch", function() {
		if(dc.tag == homemakingUtil.typeId.JiaDianWeiXiu) {
			helperOpen.open("source://view/homemaking/base/gridType.ui", {"firstTypeId" : dc.tag});
		} else {
			helperOpen.open("source://view/homemaking/base/listType.ui", {"firstTypeId" : dc.tag});
		}
	});
});